import {post,get,del} from "../util/reqest"
//加入购物车
export const addcartapi=(id,num=1)=>post("/api/v1/shop_carts",{product:id,quantity:num})

//获取购物车信息
export const getcartapi=()=>get("/api/v1/shop_carts")

// 删除单个产品
export const delcartapi=(id)=>del(`/api/v1/shop_carts/${id}`)

// 删除多个产品
export const delallcartapi=(ids)=>post("/api/v1/shop_carts/delmany",{ids})

//提交商品订单
export const saveorderapi=(data)=>post("/api/v1/orders",data);
